home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_usrdoc / NFS-SERV.{1M / README.{_1 < prev   
Text File  |  1999-09-17  |  12KB  |  397 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.              The LINUX User-Space NFS Server(1)
  12.  
  13.                         Version 2.2
  14.  
  15.  
  16.  
  17.                       October 30, 1998
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59. ____________________
  60.  
  61. 1. This  is a rewrite of the original README file (which you
  62.    can now find in README.HISTORIC).
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.                             - 1 -
  71.  
  72.  
  73.  
  74. 1.  Overview
  75.  
  76. This package contains all necessary programs  to  make  your
  77. Linux  machine  act  as  an  NFS server, being an NFS daemon
  78. (rpc.nfsd), a mount daemon (rpc.mountd), optionally, the uid
  79. mapping  daemon  (rpc.ugidd), and the showmount utility.  It
  80. was originally developed by Mark Shand, and further enhanced
  81. by  Donald  Becker,  Rick Sladkey, Orest Zborowski, Fred van
  82. Kempen, and Olaf Kirch.
  83.  
  84. Unlike other NFS daemons, the Linux nfsd  runs  entirely  in
  85. user  space.   This  makes  it  a  tad slower than other NFS
  86. implementations, and also introduces some  awkwardnesses  in
  87. the  semantics  (for  instance, moving a file to a different
  88. directory will render its file handle invalid).
  89.  
  90.  
  91. 2.  Building and installing unfsd
  92.  
  93. To compile and install the programs  in  this  package,  you
  94. first have to run the BUILD script. It will ask you a couple
  95. of questions about your preferred configuration. It tries to
  96. be  helpful  by  informing you about why it asking you which
  97. question, but a brief overview may be useful nevertheless:
  98.  
  99. multiple servers: For a long time, unfsd was not able to run
  100.      multiple   servers   in  parallel  without  sacrificing
  101.      read/write access. This was implemented only  recently,
  102.      and it has not been very widely tested.
  103.  
  104. inode numbering scheme: One  of the main features of nfsd is
  105.      that when you export  a  directory,  it  represent  the
  106.      entire  hierarchy  beneath that directory to the client
  107.      as if it were a single file system. To make this  work,
  108.      however,  it has to cram the device and inode number of
  109.      each file system object into 32 bits,  which  serve  as
  110.      the  inode  number  seen  by  the client. These must be
  111.      unique.  If  you  export  a  fairly  large  disk,   the
  112.      likelihood  of  two  different files producing the same
  113.      pseudo inode number increases, and may lead to  strange
  114.      effects (files turning into directories, etc).
  115.  
  116.      If  you've  had problems with this in the past, try out
  117.      the new inode numbering scheme.
  118.  
  119. uid/gid mapping: Occasionally, you will want  to  serve  NFS
  120.      clients whose assignment of uids and gids to user names
  121.      differs from that on  the  client.  The  unfsd  package
  122.      offers  you  several  mechanisms to dynamically map the
  123.      client's uid space to that  of  the  server,  and  vice
  124.      versa:
  125.  
  126.      static mapping: In  the  exports  file, you can provide
  127.           the NFS daemon with  a  file  that  describes  how
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.                             - 2 -
  137.  
  138.  
  139.  
  140.           individual  or entire ranges of uids and gids on a
  141.           client machine correspond to those of the  server.
  142.  
  143.      NIS mapping: The  NFS  daemon is also able to query the
  144.           NIS server of the NFS client for  the  appropriate
  145.           uids  and  gids, using the user or group names and
  146.           looking them up in the appropriate NIS  maps.  You
  147.           can  do this by specifying the client's NIS domain
  148.           in the exports file. In addition, you may have  to
  149.           edit  the  /etc/yp.conf  file  to  point  your NIS
  150.           library to the server  for  that  NIS  domain  (if
  151.           you're using NYS).
  152.  
  153.      ugidd mapping: This  is the original mechanism by which
  154.           unfsd supported dynamic uid/gid mapping. For this,
  155.           you need to run the rpc.ugidd daemon on the client
  156.           machine, and instruct the server  in  the  exports
  157.           file to use it.
  158.  
  159.           While  this  is  convenient,  it  also  presents a
  160.           security problem because rpc.ugidd can  be  abused
  161.           by  attackers to obtain a list of valid user names
  162.           for  the  client  machine.  This  can  be   helped
  163.           somewhat  by making ugidd check the requester's IP
  164.           address against  the  hosts.allow  and  hosts.deny
  165.           files  also  used by the tcpd wrapper program (see
  166.           below).
  167.  
  168.      The BUILD script will ask you whether you want  dynamic
  169.      ugidd-  or NIS-based uid mapping. If you disable ugidd-
  170.      mapping, the daemon  will  not  be  compiled,  and  the
  171.      manpage will not be installed.
  172.  
  173. file access control: For  security  reasons, mountd and nfsd
  174.      make sure that vital files  such  as  /etc/exports  are
  175.      owned  by  the  correct  user  and  have an appropriate
  176.      access mode. BUILD will ask you which  user  and  group
  177.      should   own   exports.    By  default,  this  will  be
  178.      root/root.
  179.  
  180. daemon access control: Both rpc.mountd and rpc.ugidd can  be
  181.      configured  to  use  the access control features of the
  182.      TCP wrappers package. This will let you specify in  the
  183.      /etc/hosts.allow  and  hosts.deny files which hosts are
  184.      allowed to talk to the daemons at all.  Note  that  you
  185.      still  have  to  configure  access control as described
  186.      below.
  187.  
  188.      If you do enable host access  checking  for  rpc.ugidd,
  189.      the  BUILD script will try to locate libwrap.a which is
  190.      needed  for  this.  This  library  is  part  of  Wietse
  191.      Venema's  TCP  wrapper  package. BUILD looks in several
  192.      standard locations such as /usr/lib.  If  it  does  not
  193.      find  the  library  (e.g.  because you keep it in weird
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.                             - 3 -
  203.  
  204.  
  205.  
  206.      places like /usr/i486-linux/lib), it will ask  you  for
  207.      its full path name.
  208.  
  209. mount request logging: If you enable this option, rpc.mountd
  210.      will log all attempts to mount a directory via NFS from
  211.      your server machine. This is very helpful in monitoring
  212.      NFS server usage, and for catching attempts at attcking
  213.      your machine via NFS.
  214.  
  215.      When  enabled,  mountd  will  log  all successful mount
  216.      attempts to syslog's daemon facility at  level  notice.
  217.      Failed mount attempts are logged at level warning.
  218.  
  219. After completing these questions, BUILD will run a configure
  220. script to detect certain system capabilities. This will take
  221. a  while  on  your  first  attempt.  Repeated invocations of
  222. configure will run a lot faster because the results  of  the
  223. tests  are  cached.  If  you  want to start out with a fresh
  224. build on a different release of Linux, you should make  sure
  225. to   get  rid  of  these  cached  values  by  running  `make
  226. distclean' first.
  227.  
  228. You can then compile  and  install  nfsd  by  typing  `make'
  229. and/or  (as root) `make install.' This will also install the
  230. manual pages.
  231.  
  232.  
  233. 3.  Configuring nfsd
  234.  
  235. To turn your Linux box into an NFS server, you have to start
  236. the  following programs from /etc/rc.d/rc.inet2 (or wherever
  237. your favorite  Linux  distribution  starts  network  daemons
  238. from):
  239.  
  240.    * rpc.portmap
  241.  
  242.    * rpc.mountd
  243.  
  244.    * rpc.nfsd
  245.  
  246.    * rpc.ugidd (optional)
  247.  
  248.    * rpc.pcnfsd (optional, not contained in this package)
  249.  
  250. To  make  directories  available to NFS clients, you have to
  251. enter them in your exports file along with the hosts allowed
  252. to  mount  them.   The list of options and a sample file are
  253. given in the exports(5) manual page (and the whole topic  is
  254. covered    quite    extensively   in   the   Linux   Network
  255. Administrator's Guide anyway), so I will  not  discuss  this
  256. here.  If  somebody  feels like filling in the missing parts
  257. here, please send me the diffs.
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.                             - 4 -
  269.  
  270.  
  271.  
  272. 4.  Configuring network access control
  273.  
  274. To protect rpc.ugidd or rpc.mountd from unauthorized access,
  275. you  just  have  to  add  lines  to  /etc/hosts.allow and/or
  276. /etc/hosts.deny detailing which hosts are allowed to talk to
  277. it. If your NFS server has the IP address 193.175.30.33, you
  278. would add  the  following  to  hosts.allow  and  hosts.deny,
  279. respectively:
  280.  
  281.      # hosts.allow:
  282.      rpc.ugidd: 193.175.30.33
  283.      # hosts.deny:
  284.      rpc.ugidd: ALL
  285.  
  286. If  you  have compiled the TCP wrappers package with OPTIONS
  287. support (which I highly recommend), you  can  also  put  the
  288. following into hosts.allow, which will have the same effect:
  289.  
  290.      rpc.ugidd: ALL EXCEPT 193.175.30.33 : deny
  291.  
  292. Similarly, you can limit access to  rpc.mountd  on  the  NFS
  293. server  host.  The daemon identifier to be used in this case
  294. is rpc.mountd.
  295.  
  296.  
  297. 5.  Running several Daemons Concurrently
  298.  
  299. For a long  time,  unfsd  has  not  supported  multiple  NFS
  300. processes   at   all.    This   is  paramount  to  good  NFS
  301. performance, however, as it allows other you to service  NFS
  302. requests  in  parallel.  Then,  for  a  while,  it supported
  303. multiple server processes in read-only mode (which was quite
  304. easy  as  there  is  no  need to synchronize the file handle
  305. caches between daemon processes in that case).
  306.  
  307. Starting  with  release  2.2beta32,  unfsd   also   supports
  308. multiple server processes in read/write mode. Note that this
  309. code is still experimental, and may disappear again  if  the
  310. concept doesn't work, or is too slow.
  311.  
  312.  
  313. 6.  Common Problems (a.k.a. Dependencies)
  314.  
  315.    * Root  squashing is enabled by default, which means that
  316.      requests from the root user  are  treated  as  if  they
  317.      originated  from  the  nobody user. If you want root on
  318.      the NFS client to be able to  access  files  with  full
  319.      prvilege,  you have to add no_root_squash to the option
  320.      list in /etc/exports.
  321.  
  322.    * The most specific entry  applies.  This  means  if  you
  323.      export  both  /usr  and /usr/local to a client, and the
  324.      client mounts /usr from the  server,  the  options  for
  325.      /usr/local will still apply when the client accesses
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.                             - 5 -
  335.  
  336.  
  337.  
  338.    * Wildcards  in client names only do not match dots. This
  339.      means that the entry *.foo.com only matches hosts named
  340.      joe.foo.com  etc,  but  not  joe.sales.foo.com. You may
  341.      call this a bug (and I may replace the current  pattern
  342.      matching  code with wildmat if there is enough demand).
  343.  
  344.    * Changes to the exports file do not  take  effect  until
  345.      both  nfsd and mountd have re-read the file. You either
  346.      have to kill both daemons and  restart  them,  or  send
  347.      them a HUP signal:
  348.  
  349.      # killall -HUP rpc.mountd rpc.nfsd
  350.  
  351.    * NFS  operation  between  two  Linux  boxes can be quite
  352.      slow. There are a number of reasons for this, only  one
  353.      of  which  is  that  unfsd runs in user space.  Another
  354.      (and much worse) problem is that the Linux  NFS  client
  355.      code  currently  does no proper caching, read-ahead and
  356.      write-behind of NFS data.  This problem can  be  helped
  357.      by  increasing  the  RPC transfer size on the client by
  358.      adding the `rsize=8192,wsize=8192' mount options.  This
  359.      will  at  least  improve  throughput  when  reading  or
  360.      writing large files.  You  are  still  in  a  lose-lose
  361.      situation  when applications write data line by line or
  362.      with no output buffering at all.
  363.  
  364.  
  365. 7.  Copyright
  366.  
  367. Much of the code in this package was originally  written  by
  368. Mark Shand, and is placed under the following copyright:
  369.  
  370.    This  software may be used for any purpose provided
  371.    the above  copyright  notice  is  retained.  It  is
  372.    supplied  as  is,  with  no warranties expressed or
  373.    implied.
  374.  
  375. Other code, especially that written by Rick Sladkey and some
  376. replacement routines included from the GNU libc, are covered
  377. by the GNU General Public License, version 2,  or  (at  your
  378. option) any later version.
  379.  
  380.  
  381. 8.  Bug Reports
  382.  
  383. If  you  think  you have encountered a bug in nfsd or any of
  384. the other  programs  in  this  package,  please  follow  the
  385. instructions in the file BUGS.
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.